package com.atguigu.lease.common.context;

/**
 * Author ChenYongSheng
 * Date 2025/10/14 19:46
 */

public class ThreadLocalLoginUserContext {

    private static final  ThreadLocal<LoginUser> userThreadLocal =new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser){
        userThreadLocal.set(loginUser);
    }

    public static LoginUser getLoginUser(){
        return userThreadLocal.get();
    }

    public static void remove(){
        userThreadLocal.remove();
    }

}
